Fix Oboe audio silence and routing on Android - #129
Conversation
Reordered audio initialization steps in OboeAudioRedirector.cs to ensure that BASS source mixers are moved to the "No Sound" device (Device 0) before being plugged into the Oboe master mixer. BASS automatically detaches channels from mixers when their device context is changed (via ChannelSetDevice). The previous implementation was adding sources to the mixer and then changing their device, causing immediate detachment and resulting in pure silence. Additionally improved the restoration logic to correctly move mixers back to the default device (Device 1), enabling clean toggling of the Oboe feature without a restart.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR fixes the "pure silence" issue encountered when enabling Oboe audio on Android (specifically tested on S23 Ultra).
The core problem was a misunderstanding of BASS's internal device management:
ChannelSetDeviceautomatically removes a channel from any mixer it is currently a member of. The previous logic was:Step 4 was inadvertently detaching all sources from the master mixer created in Step 1.
The fix reorders these steps to:
This ensures all memberships are preserved. I've also updated
restoreDefaultAudioto properly move mixers back to Device 1 (Default) and re-attach them to their framework parents, which fixed the issue where disabling Oboe would also result in silence until a restart.PR created automatically by Jules for task 11500574319049638210 started by @winnerspiros